package com.ellecity06.common.engine

import android.content.Context
import com.luck.picture.lib.engine.UriToFileTransformEngine
import com.luck.picture.lib.interfaces.OnKeyValueResultCallbackListener
import com.luck.picture.lib.utils.SandboxTransformUtils

/**
 * @author zavier
 * @time 2024/10/29 11:50
 * @des android 10 以上的沙盒引擎
 */
class PictureSelectorSandboxFileEngine : UriToFileTransformEngine {

    override fun onUriToFileAsyncTransform(
        context: Context?,
        srcPath: String?,
        mineType: String?,
        call: OnKeyValueResultCallbackListener?
    ) {
        val sandboxPath = SandboxTransformUtils.copyPathToSandbox(context, srcPath, mineType)
        call?.onCallback(srcPath, sandboxPath)
    }
}